package com.example.designpattern.singleton;

/**
 * @author long
 * @date 2024/12/31 14:00
 */
public class InnerClass {

    // 私有化构造器
    private InnerClass() {
    }

    private static class SingletonHolder {
        private static final InnerClass instance = new InnerClass();
    }

    public static InnerClass getInstance() {
        return SingletonHolder.instance;
    }

}



